﻿@using UCosmic.Www.Mvc.Areas.Identity.Models.Self
@model AffiliationForm
<div id="affiliation_editor">
    <div class="hidden-input">
        @Html.EditorFor(m => m.ReturnUrl)
        @Html.EditorFor(m => m.RevisionId)
        @Html.EditorFor(m => m.EntityId)
        @Html.EditorFor(m => m.EstablishmentId)
        @Html.EditorFor(m => m.PersonId)
        @Html.EditorFor(m => m.IsDefault)
    </div>
    @if (Model.Establishment.IsInstitution)
    {
        <p>
            Which of the following statements best describes your affiliation with @Model.Establishment.OfficialName?
        </p>
        <div class="field" style="margin-bottom: 0; padding-bottom: 1em;">
            <div class="messages push-down">
                @Html.ValidationMessageFor(m => m.EmployeeOrStudent)
            </div>
            <div class="font-11">
                @Html.RadioButtonFor(m => m.EmployeeOrStudent, EmployeeOrStudentAnswer.EmployeeOnly,
            new
            {
                id = string.Format("{0}_{1}", Html.IdFor(m => m.EmployeeOrStudent), EmployeeOrStudentAnswer.EmployeeOnly.ToString())
            })
                <label for="@string.Format("{0}_{1}", Html.IdFor(m => m.EmployeeOrStudent), EmployeeOrStudentAnswer.EmployeeOnly.ToString())">
                    I am an employee.
                </label>
            </div>
            <div class="font-11">
                @Html.RadioButtonFor(m => m.EmployeeOrStudent, EmployeeOrStudentAnswer.StudentOnly,
            new
            {
                id = string.Format("{0}_{1}", Html.IdFor(m => m.EmployeeOrStudent), EmployeeOrStudentAnswer.StudentOnly.ToString())
            })
                <label for="@string.Format("{0}_{1}", Html.IdFor(m => m.EmployeeOrStudent), EmployeeOrStudentAnswer.StudentOnly.ToString())">
                    I am a student.
                </label>
            </div>
            <div class="font-11 is-student">
                @Html.RadioButtonFor(m => m.EmployeeOrStudent, EmployeeOrStudentAnswer.Both,
            new
            {
                id = string.Format("{0}_{1}", Html.IdFor(m => m.EmployeeOrStudent), EmployeeOrStudentAnswer.Both.ToString())
            })
                <label for="@string.Format("{0}_{1}", Html.IdFor(m => m.EmployeeOrStudent), EmployeeOrStudentAnswer.Both.ToString())">
                    I am both an employee and a student.
                </label>
            </div>
            <div class="font-11">
                @Html.RadioButtonFor(m => m.EmployeeOrStudent, EmployeeOrStudentAnswer.Neither,
                           new
                           {
                               id = string.Format("{0}_{1}", Html.IdFor(m => m.EmployeeOrStudent), EmployeeOrStudentAnswer.Neither.ToString())
                           })
                <label for="@string.Format("{0}_{1}", Html.IdFor(m => m.EmployeeOrStudent), EmployeeOrStudentAnswer.Neither.ToString())">
                    I am neither an employee nor a student.
                </label>
            </div>
        </div>
    }
    else
    {
        @Html.HiddenFor(m => m.IsClaimingEmployee)
        <input type="hidden" id="@Html.IdFor(m => m.EmployeeOrStudent)" name="@Html.NameFor(m => m.EmployeeOrStudent)" value="@EmployeeOrStudentAnswer.EmployeeOnly.ToString()" />
    }
    <div id="employee_form" style="display: none;">
        @if (Model.Establishment.IsInstitution)
        {
            <p>
                Do you work in the international affairs office? Are you an administrator, faculty,
                or staff? Check any that apply.
            </p>
            <div class="font-11">
                @Html.CheckBoxFor(m => m.IsClaimingInternationalOffice)
                @Html.LabelFor(m => m.IsClaimingInternationalOffice)
            </div>
            <div class="font-11">
                @Html.CheckBoxFor(m => m.IsClaimingAdministrator)
                @Html.LabelFor(m => m.IsClaimingAdministrator)
            </div>
            <div class="font-11">
                @Html.CheckBoxFor(m => m.IsClaimingFaculty)
                @Html.LabelFor(m => m.IsClaimingFaculty)
            </div>
            <div class="font-11">
                @Html.CheckBoxFor(m => m.IsClaimingStaff)
                @Html.LabelFor(m => m.IsClaimingStaff)
            </div>
            <p>
                You can optionally enter your job title(s) along with college(s) &amp; department(s)
                below.
            </p>
        }
        else
        {
            <p>
                You can optionally enter your job title(s) and department(s) below.
            </p>
        }
        <div class="field" data-ucosmic-val="css">
            <span class="label" data-ucosmic-focused-class="focused">
                @Html.LabelFor(m => m.JobTitles)
            </span>
            <div class="messages" data-ucosmic-focused-class="focused">
                <span class="validation">@Html.ValidationMessageFor(m => m.JobTitles)</span>
                <div class="bottom callout border">
                    <div class="bottom callout bg">
                    </div>
                </div>
            </div>
            <div class="input">
                <div class="text-area input">
                    @Html.EditorFor(m => m.JobTitles)
                </div>
            </div>
        </div>
    </div>
    <div>
        <input id="save_changes_submit_button" type="submit" value="Save Changes" />
        @Html.Partial(MVC.Shared.Views.return_url_cancel_link, Model.ReturnUrl)
        @Html.Partial(MVC.Shared.Views.form_submitted_spinner)
    </div>
</div>
